import os
import logging
from time import sleep
from selenium import webdriver

driver = webdriver.Chrome()
driver.implicitly_wait(5)

# 获取html绝对路径
file_path = os.path.join('file:///', os.getcwd(), "selenium.html")
logging.info(file_path)

# 打开html文件
driver.get(file_path)

driver.find_element_by_xpath('/html/body/div/form/input[1]').send_keys('rabbit')
driver.find_element_by_xpath('/html/body/div/form/input[2]').send_keys('love')
driver.find_element_by_xpath('//*[@id="sub"]').click()
sleep(2)
driver.quit()
